ENT.Type = "anim";
ENT.Base = "base_anim";

ENT.PrintName = "Base BH Block";
ENT.Author = "brwarner";
ENT.Contact = "";
ENT.Purpose = "Loads specific BH block data from a file, and mimics it";
ENT.Instructions = "Not in a spawnmenu";

include('block.lua');

local blockTypes = file.FindInLua( ENT.Folder.. "/blocks/*.lua");

ENT.Blocks =  {};

for key, val in pairs( blockTypes ) do
	local char1,char2,blocktype = string.find(val, "([%w_]*)\.lua");
	
	BLOCK = BHBlock:Create();
	BLOCK.File = blocktype;
	AddCSLuaFile("blocks/"..val);
	include("blocks/"..val);
	ENT.Blocks[blocktype] = BLOCK;
	BLOCK = nil;
end

//Thanks to some site, not mine
function deepcopy(object)
    local lookup_table = {}
    local function _copy(object)
        if type(object) ~= "table" then
            return object
        elseif lookup_table[object] then
            return lookup_table[object]
        end
        local new_table = {}
        lookup_table[object] = new_table
        for index, value in pairs(object) do
            new_table[_copy(index)] = _copy(value)
        end
        return setmetatable(new_table, _copy(getmetatable(object)))
    end
    return _copy(object)
end
